package com.zuul.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: lvchao
 * @Date: 2018-12-11 14:42
 * @Email:641819417@qq.com
 */
@Service
public class RestTemplateService {

    @Value("${restUrl.userServiceRest}")
    private String userServiceUrl;

    @Autowired
    RestTemplate restTemplate;

    public JSONArray userLogin(String account, String password) {
        Map map = new HashMap();
        map.put("account", account);
        map.put("password", password);
        return (JSONArray)this.restTemplate.getForObject("http://testnetproblem" + "/hi", JSONArray.class);
    }

}
